package com.beardedcoder.lowPower.dao;

import com.beardedcoder.lowPower.model.BatteryData;

import android.database.SQLException;

/**
 * Provides functionality around persisting {@link Battery} data.
 * @author bilbovb
 *
 */
public interface BatteryDao
{
	/**
	 * Load a BatteryData object from the persistent store.
	 * @param id the unique id to load the row for.
	 * @return 
	 * @throws SQLException if something goes wrong with reading form the persistent storage.
	 */
	public BatteryData findById(long id);
	/**
	 * Persist a battery data object into the persistent store.
	 * The id field of the battery will now contain the unique id for that row.
	 * @param battery the battery to persist.
	 * @throws NullPointerException if the battery to persist is null.
	 * @throws SQLException if something goes wrong with writing to the persistent store.
	 */
	public void insert(BatteryData battery);
}
